//
//  UIImage+Image.m
//  BuDeJie
//
//  Created by zuqiu on 17/10/27.
//  Copyright © 2017年 zuqiu. All rights reserved.
//

#import "UIImage+Image.h"

@implementation UIImage (Image)
+ (instancetype)imageOriginalWithName:(NSString *)imageName
{
    UIImage *image= [UIImage imageNamed:imageName];
    return  [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}

- (instancetype)zq_circleImage
{
    UIGraphicsBeginImageContextWithOptions(self.size, NO, 0);
    UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, self.size.width, self.size.height)];
    [path addClip];
    [self drawAtPoint:CGPointZero];
   UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsGetCurrentContext();
    return image;
}

+ (instancetype)zq_circleImageNamed:(NSString *)name
{
    return [[self imageNamed:name] zq_circleImage];
}
@end
